// @author: caoshi
// @date: 2021-04-28 21:52
package main

import (
	"fmt"
	"time"
)

func main() {

	ch1 := make(chan int)

	go func() {
		fmt.Println("子groutine开始执行")
		//time.Sleep(3 * time.Second)
		data := <-ch1 // 从ch1中读取数据
		fmt.Println("data = ", data)
	}()

	time.Sleep(5 * time.Second)
	ch1 <- 10
	fmt.Println("main over ...")

	// 没有channel来读取数据, 所以会出现死锁
	//ch2 := make(chan int)
	//ch2 <- 100
}
